package com.netty.server.base;

import com.netty.server.processor.DownProcessor;
import com.netty.server.processor.UpProcessor;
import com.netty.server.utils.CmdIdGenerator;
import io.netty.channel.EventLoopGroup;
import lombok.Builder;
import lombok.Data;

@Data
@Builder
public class TankEnvironment {

    private EventLoopGroup bossGroup;

    private EventLoopGroup workGroup;

    private TankParams tankParams;

    private CmdIdGenerator cmdIdGenerator;

    private RequestRegister register;

    private ConnectionGroup connectionGroup;

    private UpProcessor upProcessor;

    private DownProcessor downProcessor;

    public void release() throws InterruptedException {
        bossGroup.shutdownGracefully().sync();
        workGroup.shutdownGracefully().sync();
    }
}
